//
//  UIImage+ExColor.h
//  OC-Example
//
//  Created by lcj on 2020/11/3.
//  Copyright © 2020 apang.men. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, APMGradientImageType) {
    APMGradientImageTypeTopToBottom             =       0,
    APMGradientImageTypeLeftToRight             =       1,
    APMGradientImageTypeLeftTopToRightBottom    =   2,
    APMGradientImageTypeRightTopToLeftBottom    =   3
};

@interface UIImage (ExColor)
+ (UIImage *)apm_imageWithColor:(UIColor *)color;
+ (UIImage *)apm_imageWithColor:(UIColor *)color size:(CGSize)size;
+ (UIImage *)apm_imageWithColor:(UIColor *)color size:(CGSize)size radius:(CGFloat)radius;
/**
 * 生成渐变色图片(目前颜色是平均分布的)
 * @parame  colors  渐变色数组
 * @parame  gradientType    渐变方向
 * @parame  size  图片尺寸
 * @parame  radius  是否圆角
 */
+ (nullable UIImage *)apm_gradientImageWithColors:(NSArray <UIColor *> *)colors
                                     gradientType:(APMGradientImageType)gradientType
                                             size:(CGSize)size
                                           radius:(CGFloat)radius;

+ (nullable UIImage *)apm_gradientImageWithColors:(NSArray <UIColor *> *)colors
                                     gradientType:(APMGradientImageType)gradientType
                                             size:(CGSize)size;
/**
 * 生成纯色带边框圆角图片
 * @parame  size  图片尺寸
 * @parame  fillColor  背景填充颜色
 * @parame  strokeColor 边框颜色
 * @parame  strokeWidth 边框宽度，默认1
 * @parame  radius  是否圆角
 */
+ (nullable UIImage *)apm_imageWithSize:(CGSize)size
                              fillColor:(UIColor *)fillColor
                            strokeColor:(UIColor * _Nullable)strokeColor
                            strokeWidth:(CGFloat)strokeWidth
                                 radius:(BOOL)radius;

/**
 * 生成镂空圆角图片
 * @parame  size  图片尺寸
 * @parame  lineColor  边框颜色
 * @parame  lineWidth   边框宽度，默认1
 * @parame  radius  是否圆角
*/
+ (nullable UIImage *)apm_hollowImageWithSize:(CGSize)size
                                    lineColor:(UIColor *)lineColor
                                    lineWidth:(CGFloat)lineWidth
                                       radius:(BOOL)radius;
@end

NS_ASSUME_NONNULL_END
